package com.hb.common.handler.os;

import com.hb.common.constant.Config;
import org.springframework.stereotype.Component;

@Component
public class LinuxOSHandler implements OSHandler {

    @Override
    public String[] assembleCommand(String command) {
        String[] cmd = new String[3];
        cmd[0] = "/bin/sh";
        cmd[1] = "-c";
        cmd[2] = "./" + command;
        return cmd;
    }

    @Override
    public String getOsPath() {
        return Config.LINUX + "/";
    }

    @Override
    public String getOSName() {
        return Config.LINUX;
    }

}
